<template>
  <div>
    <Title title="统计概况" />
    <div class="container flex-row align-center">

      <div class="item flex-row align-center">
        <img src="@/assets/images/img1.png" />
        <div class="item-right">
          <div class="item-num">
            <span class="item-num-text color-1">{{traderNum}}</span>
            <span class="item-unit">个</span>
          </div>
          <div class="item-name">入住商家</div>
        </div>
      </div>

      <div class="item flex-row align-center">
        <img src="@/assets/images/img2.png" />
        <div class="item-right">
          <div class="item-num">
            <span class="item-num-text color-2">{{oilNum}}</span>
            <span class="item-unit">个</span>
          </div>
          <div class="item-name">隔油池</div>
        </div>
      </div>

      <div class="item flex-row align-center">
        <img src="@/assets/images/img3.png" />
        <div class="item-right">
          <div class="item-num">
            <span class="item-num-text color-3">{{trashNum}}</span>
            <span class="item-unit">吨</span>
          </div>
          <div class="item-name">易腐烂垃圾处理总量</div>
        </div>
      </div>

    </div>
  </div>
</template>

<script>
import Title from '@/components/Title.vue'
import {  apiGetMerchantAndOilPoolStatistics } from '@/api/api'
export default {
  components: { Title },

  data () {
    return {
      traderNum: 0,//商户
      oilNum: 0,//隔油池量
      trashNum: 0,
    }
  },
  created () {
    this.getCount();
  },
  methods: {
    getCount () {
      apiGetMerchantAndOilPoolStatistics().then(res => { 
        if (res.code == 1) {
          this.traderNum = res.data.mCount
          this.oilNum = res.data.oilCount
          this.trashNum = res.data.perishableGarbageSum
        }
      })
    }
  }

}
</script>

<style lang="scss" scoped>
.container {
  margin-top: 12px;
  .item {
    margin-right: 60px;

    &:last-child {
      margin-right: 0;
    }
    img {
      width: 60px;
      height: 60px;
    }
    .item-right {
      margin-left: 8px;

      .color-1 {
        color: #69c0ff;
      }

      .color-2 {
        color: #ffc53d;
      }

      .color-3 {
        color: #6be6de;
      }

      .item-num {
        .item-num-text {
          font-size: 32px;
          font-family: PangMenZhengDaoBiaoTiTiMianFeiBan,
            PangMenZhengDaoBiaoTiTiMianFeiBan;
          font-weight: normal;

          line-height: 40px;
        }

        .item-unit {
          margin-left: 4px;
          font-size: 14px;
          font-weight: 400;
          color: #b6d9fc;
          line-height: 20px;
        }
      }

      .item-name {
        font-size: 14px;
        font-weight: 400;
        color: #b6d9fc;
        line-height: 24px;
      }
    }
  }
}
</style>